package educationaladministrationsystem.CSM.Mapper.Service;

import educationaladministrationsystem.CSM.Mapper.Service.ServiceInterface.Login;
import educationaladministrationsystem.Class.Count;
import educationaladministrationsystem.CSM.Mapper.LoginMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginService implements Login {
    @Autowired
    LoginMapper loginMapper;

    //    查看帐号是否存在
    @Override
    public boolean isHaveAboutCount(Count count) {
        return loginMapper.getCount(count) != 0;
    }

    //    新增帐号
    @Override
    public boolean insertAboutCount(Count count) {
        return loginMapper.insertCount(count) != 0;
    }

    @Override
    public void PasswordUpdate(String newPassword, String countNumber) {
        loginMapper.PasswordUpdate(newPassword, countNumber);
    }

    @Override
    public String getUID(String countNumber) {
        return loginMapper.getUID(countNumber);
    }
}
